learn (something) the hard way
to find out how to behave by learning from your mistakes or from unpleasant experiences, rather than from being told